package com.neusoft.elmboot.controller;

import com.neusoft.elmboot.result.Result;
import com.neusoft.elmboot.service.PointServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 积分
 * Controller
 */
@Slf4j
@RestController
@RequestMapping("/PointController")
public class PointController {

    @Autowired
    PointServer pointServer;

    /**
     * 根据用户ID查询积分
     * @param userId
     * @return
     */
    @RequestMapping("/showPointByUserId")
    public Result<Double> showPointByUserId(String userId){
        Double res = pointServer.showPointByUserId(userId);
        log.info("调用接口：根据用户ID查询积分");
        return Result.success(res);
    }
}
